    
    /**
     * 通用过滤
     * @params search 快捷搜索
     * @param rules 查询的规则，例如[{field: "a.:[gs]", valueType: "control", value: "dddGs", opt:"="}, {field: "a.:[wldw], valueType: "const", value: "a", opt:"="}]其中field为查询的字段，valueType分为control和const，control表示从控件取值，const表示常量,opt标识条件
     * @prams domObj ycWindow.dom对象
     * @params tableId 表格控件id
     */
    const table_query_by_filter = (search, rules, domObj, tableId) => {
        let sqlCondition = "1=1"
        const sqlValues = []
        rules.forEach(rule => {
            const value = rule.valueType === "control" ? domObj.getControlByName(rule.value).getValue() : rule.value;
            let hasValue = false
            let valueIsArray = typeof (value) === 'array'
            if (valueIsArray) {
                hasValue = value.length > 0
            } else {
                hasValue = value !== "" && value !== null && value !== undefined
            }
            debugger
            // 如果控件中有值
            if (hasValue) {
                if (valueIsArray) {
                    sqlCondition += "( 1=-1"
                    value.forEarch(v => {
                        sqlCondition += ` or ${rule.field} = ?`
                        sqlValues.push(v)
                    })
                    sqlCondition += "("
                } else {
                    sqlCondition += " and "+rule.field+" "+(rule.opt?rule.opt:"=")+" ?"
                    sqlValues.push(value)
                }
            }
        })

        console.log({ condition: sqlCondition, values: JSON.stringify(sqlValues) })
        if (sqlCondition) {
            domObj.getControlByName(tableId).setFilterAndReload(search, { condition: sqlCondition, values: JSON.stringify(sqlValues) }, false)
        } else {
            domObj.getControlByName(tableId).setFilterAndReload(search, null, false)
        }
    }